package com.itheima.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 用户
 */
@Data
@TableName(value = "t_user")
public class User implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id; // 主键
    private Date birthday; // 生日
    private String gender; // 性别
    @TableField(value = "USERNAME")
    private String username; // 用户名，唯一
    private String password; // 密码
    private String remark; // 备注
    private String station; // 状态
    private String telephone; // 联系电话
    @TableField(exist = false)
    private List<Role> roles;
    //private Set<Role> roles = new HashSet<Role>(0);//对应角色集合


    public User() {
    }

    public User(Integer id, Date birthday, String gender, String username, String password, String remark, String station, String telephone, List<Role> roles) {
        this.id = id;
        this.birthday = birthday;
        this.gender = gender;
        this.username = username;
        this.password = password;
        this.remark = remark;
        this.station = station;
        this.telephone = telephone;
        this.roles = roles;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setStation(String station) {
        this.station = station;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }
}
